#!/usr/bin/env node

const http = require('http'),
        log = console.log;

http.createServer((req, res) => {
  log("req.method=",req.method);
  switch(req.method) {
        case 'GET':
          res.end('get');
          break
        case 'PUT':
          res.end('put')
          break;
        case 'POST':
          res.end('post');
          break;
        case 'DELETE':
          res.end('delete');
          break;
        default:
          res.end('request method not support');
  }
}).listen(8080);
